var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
define(["require", "exports", "common/static/index"], function (require, exports, index_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    class AccountService extends index_1.Service {
        url(path) {
            return `/AdminAccount/${path}`;
        }
        offlinePayOrder(orderId, userId, paymentType, amount) {
            let url = this.url('Account/OfflinePayOrder');
            return this.put(url, { orderId, userId, paymentType, amount });
        }
        /**
         * 创建收款记录
         */
        createReceivement(orderId, amount, accountId) {
            let receivement = {
                Id: orderId,
                Amount: amount,
                AccountId: accountId,
            };
            let url = this.url('Account/CreateReceivement');
            return this.postByJson(url, { orderId, receivement });
        }
        receivementAccountList() {
            return __awaiter(this, void 0, void 0, function* () {
                let url = this.url('Account/ReceivementAccountList');
                let result = yield this.get(url);
                return result;
            });
        }
        saveReceivementAccount(account) {
            let url = this.url('Account/SaveReceivementAccount');
            return this.postByJson(url, { model: account });
        }
        createBill(userId, amount) {
            let url = this.url(`Account/CreateBill`);
            return this.postByJson(url, { userId, amount });
        }
        recharge(userId, billId, receivementAccountId) {
            let url = this.url('Account/Recharge');
            return this.post(url, { userId, billId, receivementAccountId });
        }
    }
    exports.AccountService = AccountService;
});
